#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
#include <sys/wait.h>

int main()
{
  pid_t pid;
  pid = fork();
  if(pid == 0)
  {
    printf("my pid is %d\n",getpid());
    sleep(10);
  }
  if(pid > 0)
  {
    int status;
    wait(&status);
    if(WIFSIGNALED(status))
    {
      printf("child is killed signal %d\n",WTERMSIG(status));
    }
  }
  return 0;
}
